ToolApprovalRequest

@Serializable
@SerialName(value = "tool-approval-request")
data class ToolApprovalRequest(val toolCallId: String, val toolName: String, val input: JsonElement, val approvalId: String? = null, val signature: String? = null, val providerMetadata: Map<String, JsonElement>? = null) : ContentPart

Assistant content: the LLM called a tool that requires approval.

Constructors

Link copied to clipboard
constructor(toolCallId: String, toolName: String, input: JsonElement, approvalId: String? = null, signature: String? = null, providerMetadata: Map<String, JsonElement>? = null)

Properties

Link copied to clipboard

Approval-identity key distinct from toolCallId per v6 (gap #7 in historical parity work). Null defaults to toolCallId for the common single-approval case; explicit value lets two approvals share a tool-call id without correlation ambiguity.

Link copied to clipboard
val input: JsonElement
Link copied to clipboard
val ContentPart.metadata: Map<String, JsonElement>?
Link copied to clipboard
val providerMetadata: Map<String, JsonElement>?
Link copied to clipboard

HMAC-SHA256 signature binding this approval to its tool call (v6.0.202). Present only when the agent is configured with experimental_toolApprovalSecret; verified fail-closed when the approval is replayed.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T> ContentPart.providerMetadataAs(provider: String): T?
fun <T> ContentPart.providerMetadataAs(provider: String, serializer: KSerializer<T>): T?